import 'package:flutter/material.dart';
import 'package:hkzf/widgets/common_image.dart';
import './function_button_data.dart';

class FunctionButton extends StatelessWidget {
  const FunctionButton({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Wrap(
        children: list
            .map((e) => GestureDetector(
                  onTap: () {
                    if (e.onTapHandle != null) e.onTapHandle(context);
                  },
                  child: Container(
                    padding: EdgeInsets.symmetric(vertical: 20),
                    child: Column(
                      children: [
                        CommonImage(
                          e.imageUri,
                          width: 50,
                        ),
                        Text(e.title)
                      ],
                    ),
                    width: MediaQuery.of(context).size.width / 3,
                  ),
                ))
            .toList());
  }
}
